public class d5test2 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4};
//        getMax(arr);
//        getMin(arr);
//        getAvg(arr);
//        getCount(arr);
        getDiyuPingJunZhi(arr);

    }
    public static int getMax(int[] arr){
//        int[] a = {1,2,3,45};
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if(max < arr[i]){
                max = arr[i];
            }
        }
        System.out.println(max);
        return  max;
    }
    public static int getMin(int[] arr){
         int min = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if(min > arr[i]){
                min = arr[i];
            }
        }
        System.out.println(min);
        return  min;
    }
    public static double getAvg(int[] arr){
         int min = arr[0];
        for (int i = 1; i < arr.length; i++) {
            min+=arr[i];
        }
        System.out.println((double) min / arr.length);
        return  (double) min / arr.length;
    }
    public static int getCount(int[] arr){
         int min = arr[0];
        for (int i = 1; i < arr.length; i++) {
            min+=arr[i];
        }
        System.out.println(min);
        return  min;
    }
    public static int getDiyuPingJunZhi(int[] arr){

        double avg = getAvg(arr);

        int res = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] < avg){
                res +=1;

            }
        }


        System.out.println(res);
        return  res;
    }

}
